package com.atguigu.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.atguigu.service.HelloService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController //@Controller + @ResponseBody
//@Controller
public class HelloController {
    //@Autowired
    @Reference
    HelloService helloService;

   // @ResponseBody
    @RequestMapping("/hello")
    public String sayHello(String name){
        String result = helloService.sayHello(name);
        System.out.println(result);
        return result;
    }
}
